# coding:utf-8
import jieba

with open('xiaoe.txt', encoding='utf-8') as f:
    lines = f.read().split('\n')
with open('../dic_text/author.txt', encoding='utf-8')as f:
    word_list = f.read().split('\n')

for line in lines:
    row = line.split('\t')
    new_word_list = set(list(jieba.cut_for_search(row[1])) + list(jieba.cut_for_search(row[2])))
    if '' in new_word_list:
        new_word_list.remove('')
    if ' ' in new_word_list:
        new_word_list.remove(' ')
    word_list.extend(new_word_list)

with open('../dic_text/author.txt', 'w', encoding='utf-8')as f:
    f.write('\n'.join(word_list))
